Beginning SAP Fiori by Bince Mathew
Author:Bince Mathew
Language: eng
Format: epub, pdf
Publisher: Apress, Berkeley, CA
Next you create the controller page for your Users view, to handle events like button clicks, page loads, and so on (see Listing 5-8). The selectedRow function gets the details of any row the user clicks in the table. Similarly, you use JQuery functions to read values directly from fields and toggle the visibility of the form that contains the input fields for creating and editing records based on button clicks.
Listing 5-8. Users.controller.js (Controller Page to Handle the Events of the View)
selectedRow: function(oEvent){
currentRowContext = oEvent.getParameter("rowContext").sPath;
var start = currentRowContext.lastIndexOf('/') + 1;
value = currentRowContext.substring(start, currentRowContext.length);
var oTable = sap.ui.getCore().byId('Table1');
index = oTable.getSelectedIndex();
var data= oTable.getModel().oData[value];
mode = "Update";
$('#Userid').val(data.Userid);
$('#Name').val(data.Name);
$('#Designation').val(data.Designation);
var userId = sap.ui.getCore().byId('Userid');
userId.setEditable(false);
},
Create: function(){
$('#form1').slideDown();
mode = "Create";
$('#Userid').val("");
$('#Name').val("");
$('#Designation').val("");
var userId = sap.ui.getCore().byId('Userid');
userId.setEditable(true);
},
Edit: function(){
$('#form1').slideDown('1000');
mode = "Update";
var oTable = sap.ui.getCore().byId('Table1');
index = oTable.getSelectedIndex();
var data= oTable.getModel().oData[value];
$('#Userid').val(data.Userid);
$('#Userid').editable = false;
$('#Name').val(data.Name);
$('#Designation').val(data.Designation);
},
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
| Content Management | Programming |
| User Experience & Usability | User Generated Content |
| Web Design | Web Marketing |
| Web Services | Website Analytics |
The Mikado Method by Ola Ellnestam Daniel Brolund(20603)
Hello! Python by Anthony Briggs(19898)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(18208)
Dependency Injection in .NET by Mark Seemann(18107)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(17575)
Kotlin in Action by Dmitry Jemerov(17183)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(13265)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(11381)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(9386)
Svelte with Test-Driven Development by Daniel Irvine(8139)
Test-Driven Development with PHP 8 by Rainier Sarabia(7888)
Layered Design for Ruby on Rails Applications by Dementyev Vladimir;(7707)
Web Development with Django by Ben Shaw Saurabh Badhwar(7216)
React Application Architecture for Production by Alan Alickovic(6899)
Software Architecture for Web Developers by Mihaela Roxana Ghidersa(4980)
Audition by Ryu Murakami(4888)
Accelerating Server-Side Development with Fastify by Manuel Spigolon Maksim Sinik & Matteo Collina(4837)
Solidity Programming Essentials by Ritesh Modi(4565)
Build Your Own Web Framework in Elixir by Aditya Iyengar(4438)